function Part(){
    this.addListener();
}

Part.PartTemplate = `
      <div class="container col-md-12">
 <table class="table table-striped">
  <thead>
    <button type="button" class="btn btn-default">搜索</button>&nbsp;
    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addpModal">增加</button>&nbsp;
     <div class="col-xs-2">
    <input type="text" class="form-control" placeholder="">
  </div>
  </thead>
  <tbody>
    <tr>
        <td><input type="checkbox"></td>
        <td>部门编号</td>
        <td>部门名称</td>
        <td>部门简称</td>
        <td>备注</td>
        <td>操作</td>
    </tr>
    <tr>
        <td><input type="checkbox"></td>
        <td>1001</td>
        <td>吴菲菲</td>
        <td>男</td>
        <td>经理</td>
        <td><a href=""  data-toggle="modal" data-target="#xgpModal">编辑</a>&nbsp;<a href=""  data-toggle="modal" data-target="#ckpModal">查看</a>&nbsp;<a href="">删除</a></td>
    </tr>
    <tr>
        <td><input type="checkbox"></td>
        <td>1001</td>
        <td>吴菲菲</td>
        <td>男</td>
        <td>经理</td>
        <td><a href="">编辑</a>&nbsp;<a href="">查看</a>&nbsp;<a href="">删除</a></td>
    </tr>
    <tr>
        <td><input type="checkbox"></td>
        <td>1001</td>
        <td>吴菲菲</td>
        <td>男</td>
        <td>经理</td> 
        <td><a href="">编辑</a>&nbsp;<a href="">查看</a>&nbsp;<a href="">删除</a></td>
    </tr>
  </tbody>
</table>
<!-- Modal -->
<div class="modal fade" id="addpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">添加新部门信息</h4>
      </div>
      <div class="modal-body">
        <form>
  <div class="form-group">
    <label for="exampleInputEmail1">部门编号</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门名称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门简称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
    <div class="form-group">
    <label for="exampleInputPassword1">备注</label>
    <input type="text" class="form-control" placeholder="">
  </div>
</form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary btn-add-1">添加</button>
      </div>
    </div>
  </div>
</div>
<!-- Modal -->
<div class="modal fade" id="xgpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">修改部门信息</h4>
      </div>
      <div class="modal-body">
        <form>
  <div class="form-group">
    <label for="exampleInputEmail1">部门编号</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门名称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门简称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
    <div class="form-group">
    <label for="exampleInputPassword1">备注</label>
    <input type="text" class="form-control" placeholder="">
  </div>
</form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary">确认修改</button>
      </div>
    </div>
  </div>
</div>
<!-- Modal -->
<div class="modal fade" id="ckpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">查看部门信息</h4>
      </div>
      <div class="modal-body">
        <form>
  <div class="form-group">
    <label for="exampleInputEmail1">部门编号</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门名称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">部门简称</label>
    <input type="text" class="form-control" placeholder="">
  </div>
    <div class="form-group">
    <label for="exampleInputPassword1">备注</label>
    <input type="text" class="form-control" placeholder="">
  </div>
</form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">确认</button>
      
      </div>
    </div>
  </div>
</div>
</div>`;

Part.partRowTemplate = `
<tr>
    <td><input type="checkbox"></td>
    <td><%= id %></td>
    <td><%= name %></td>
    <td><%= sex %></td>
    <td><%= position %></td>
    <td><a href="">编辑</a>&nbsp;<a href="">查看</a>&nbsp;<a href="">删除</a></td>
</tr>`;

  $.extend(Part.prototype,{
    addListener(){
      $(".part-btn").on("click",this.createDom);
      // $("btn-add-1").on("click",this,parthandler);
    },
    //渲染模板
    createDom(){
        $("#content").html(Part.PartTemplate);
    },
  });
new Part();
